#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>

int main(int argc, char **argv)
{
	int fd=0;
	int data=0;

	if(argc !=3)
		printf("Usage error %s\r\n",argv[0]);

	fd = open(argv[1],O_RDWR);
	if(fd <0)
	{
		printf("open file:%s error\r\n",argv[1]);
		return -1;
	}

	data = atoi(argv[2]);
	write(fd,&data,1);
	
	close(fd);

	return 0;
}



